<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="author" content="order by dede58.com"/>
    <title>个人信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" href="common/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="common/bootstrap/css/bootstrap.css" media="all">
    <link rel="stylesheet" type="text/css" href="common/global.css" media="all">
    <link rel="stylesheet" type="text/css" href="css/personal.css" media="all">
    <script type="text/javascript" src="js/jquery2.js"></script>
</head>
<body>
<section class="layui-larry-box">
    <div class="larry-personal">
        <header class="larry-personal-tit">
            <span>添加部门</span>
        </header><!-- /header -->
        <div class="larry-personal-body clearfix">
            <form class="layui-form col-lg-5" id="deptForm">
                <div class="layui-form-item">
                    <label class="layui-form-label">部门编号</label>
                    <div class="layui-input-block">
                        <input type="text" name="dbian" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">部门名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="dname" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">上级部门</label>
                    <div class="layui-input-block">
                        <select class="layui-select" name="pid" id="sel" style="display: block; width: 170px"
                                lay-filter="aihao">
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">部门负责人</label>
                    <div class="layui-input-block">
                        <input type="text" name="dmanager" autocomplete="off" class="layui-input" placeholder="输入负责人名称">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">部门电话</label>
                    <div class="layui-input-block">
                        <%--<input type="radio" name="sex" value="男" title="男" checked=""><div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><span>男</span></div>--%>
                        <%--<input type="radio" name="sex" value="女" title="女"><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><span>女</span></div>--%>
                        <input type="text" name="dtel" autocomplete="off" class="layui-input" placeholder="输入部门电话">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">传真</label>
                    <div class="layui-input-block">
                        <input type="text" name="dfax" autocomplete="off" class="layui-input" placeholder="传真">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">Email</label>
                    <div class="layui-input-block">
                        <input type="text" name="demail" autocomplete="off" class="layui-input" placeholder="邮箱">
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">部门职责</label>
                    <div class="layui-input-block">
                        <textarea placeholder="既然选择了远方，便只顾风雨兼程；路漫漫其修远兮，吾将上下而求索" name="duty"
                                  class="layui-textarea"></textarea>
                    </div>
                </div>
            </form>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" id="sub">立即提交</button>
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript" src="common/layui/layui.js"></script>
<script>
    $(function () {
        $.ajax({
            type: "get",
            url: "positionController/queryPositionAll",
            dataType: "json",
            success: function (data) {
                // console.log( typeof data);
                $.each(data, function (index, da) {
                    var options = $("<option value='" + da.id + "'>" + da.wname + "</option>");
                    $("#sel").append(options);
                });
            },
            error: function () {
                window.location.href = "404.jsp";
            }
        });

        $("#sub").on("click", function () {
            $.ajax({
                type: "get",
                url: "dept/insertDept",
                data: $("#deptForm").serialize(),
                success: function () {
                    window.location.href = "showDeptData.jsp";
                },
                error: function (data) {
                    window.location.href = "404.jsp";
                }
            });
        });
    })
</script>

<script src="js/tao.js"></script>

<script>
    $(document).ready(function (e) {
        /*禁止右键和隐藏鼠标*/
        $("body").bind("contextmenu", function () {
            return false;
        });

        /*定义文字最底部显示到哪儿*/
        var guangs = ["　", "|", "　", "|"];
        var guangBiao = "/";
        var guangSub = 0;
        var guang = setInterval("$.guang()", 120);

        var subs = 0;
        var string = "某人…… ██我喜欢你██真的很喜欢很喜欢你███你知道吗…每个噩梦惊醒的夜晚...总会依赖的想起你██每当夜深人静想起你的时候……眼泪总是忍不住的往下流██每当流星划过寂静的天边……都会为你许下祝福的心愿██我依旧对你那么思念██不管你怎么样……我对你的爱永远不会改变██我只是个很普通的人……可能配不上你██如果因为我的表白而影响你的学习……那很抱歉……██我可以等你……不管3年还是5年……██████████PS.青春美好——算了吧。。再弄也是白费力气的。。她是不可能接受的。。。我想了很多。。。也许。。她从来没有想过。。也从来没有一点点的喜欢我。。。██我。。真的很差。。。████████我希望你能够答应我 <-- The End -->";
        $.intent = function (str) {
            str = "　　" + str;
//        var reg=new RegExp("/█{1,2}/","i"); //创建正则RegExp对象
            str = str.replace(eval("/█/gi"), "█");

            return str;
        }
        string = $.intent(string);

        var echo = setInterval("$.echo()", 300);

        $.guang = function () {
            if (guangSub < guangs.length - 1) {
                guangSub++;
            } else {
                guangSub = 0;
            }
            guangBiao = guangs[guangSub];
            $("#guang").html(guangBiao);

        }

        // $.echo=function(){
        //     if(subs<string.length){
        //         $("#txt").html($("#txt").html()+$.repl(string.substr(subs,1)));
        //         if($("#guang").offset().top > document.body.scrollHeight / 2){
        //             window.scrollTo(0,$("#guang").offset().top);
        //         }
        //         $(".des").css("bottom","0px");
        //         subs++;
        //     }
        // }
        $.repl = function (str) {
            str = str.replace("\r\n", "<br/>");
            str = str.replace("\n", "<br/>");
            str = str.replace("█", "<br/>");
            return str;
        }
    });
</script>
<div id="bubbles" style="visibility:hidden">
    <img src="${pageContext.request.contextPath}/images/1.png">
    <img src="${pageContext.request.contextPath}/images/2.png">
    <img src="${pageContext.request.contextPath}/images/1.png">
</div>
</body>
</html>